From 52c24132c30318ee5345be530bcba6e53c713bd8 Mon Sep 17 00:00:00 2001 From: Alastair Tse Date: Tue, 30 Jan 2007 11:56:27 +0000 Subject: [PATCH] [XEND] Fix bootable flag bypass in XendConfig Signed-off-by: Alastair Tse --- tools/python/xen/xend/XendConfig.py | 8 ++++---- tools/python/xen/xend/server/XMLRPCServer.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/python/xen/xend/XendConfig.py b/tools/python/xen/xend/XendConfig.py index cc2655d60e..5a6555e9c7 100644 --- a/tools/python/xen/xend/XendConfig.py +++ b/tools/python/xen/xend/XendConfig.py @@ -881,10 +881,10 @@ class XendConfig(dict): if sxp.name(config) in ('vbd', 'tap'): # The bootable flag is never written to the # store as part of the device config. - uuid = sxp.child_value(sxpr, 'uuid') - sxpr.append( - 'bootable', - self['devices'][dev_uuid]['bootable']) + dev_uuid = sxp.child_value(config, 'uuid') + dev_type, dev_cfg = self['devices'][dev_uuid] + config.append(['bootable', + int(dev_cfg['bootable'])]) sxpr.append(['device', config]) found = True diff --git a/tools/python/xen/xend/server/XMLRPCServer.py b/tools/python/xen/xend/server/XMLRPCServer.py index 722ccb4b2b..09a66549e9 100644 --- a/tools/python/xen/xend/server/XMLRPCServer.py +++ b/tools/python/xen/xend/server/XMLRPCServer.py @@ -34,7 +34,7 @@ from xen.xend.XendError import XendInvalidDomain def fixup_sxpr(sexpr): ret = [] for k in sexpr: - if type(k) in (types.ListType, types.TupleType): + if type(k) in (list, tuple): if len(k) != 2 or k[0] != 'vcpu_avail': ret.append(fixup_sxpr(k)) else: -- 2.30.2